package com.design.visitor.general;

import java.util.ArrayList;
import java.util.List;

/**
 * 结构对象
 *  * @author:         cong zhi@
 * @createDate:     2023/8/4 14:28
 * @updateUser:     cong zhi
 * @updateDate:     2023/8/4 14:28
 * @updateRemark:   修改内容
 * @version:        v1.0
 */
public class ObjectStructure {

    private List<Element> list = new ArrayList<>();

    {
        this.list.add(new ConcreteElementA());
        this.list.add(new ConcreteElementB());
    }

    public void accept(Visitor visitor) {

        for (Element element : this.list) {
            element.accept(visitor);

        }
    }
}
